<!--
    @Description: 大屏默认页
    @author: 拾光丶
    @date: 2023/8/14 上午 9:31
    @projectName: ruoyi-ui
    @path: src/views/bigscreen
-->
<template>
  <div class="container">
    <div class="tableOfContents">
      <div class="yearItem" v-for="item in yearList" :key="item.id" @click="goHome(item.cp002)">
        {{ item.wmdaName }}
      </div>
    </div>
  </div>
</template>

<script>

export default {
  // import 引入的组件需要注入到对象中才能使用
  components: {},
  props: {},
  data() {
    // 这里存放数据
    return {
      yearList: []
    }
  },
  created() {
    this.getYear()
  },
  // 方法集合
  methods: {
    /**
     * 获取年
     */
    getYear() {
      setTimeout(() => {
        this.yearList = [
          {
            'searchValue': null,
            'createBy': '',
            'createTime': '2020-07-14 10:10:48',
            'updateBy': '',
            'updateTime': '2020-07-14 10:12:06',
            'remark': null,
            'params': {},
            'id': 577,
            'orderNum': 2018,
            'parentId': 576,
            'wmdaName': '2018年',
            'cp002': '2018',
            'dictid': null,
            'ext1': null,
            'ext2': '1',
            'ext3': '2018',
            'ext4': null,
            'ext5': null,
            'children': []
          },
          {
            'searchValue': null,
            'createBy': '',
            'createTime': '2020-07-14 10:11:05',
            'updateBy': '',
            'updateTime': '2020-07-14 10:11:58',
            'remark': null,
            'params': {},
            'id': 578,
            'orderNum': 2019,
            'parentId': 576,
            'wmdaName': '2019年',
            'cp002': '2019',
            'dictid': null,
            'ext1': null,
            'ext2': '1',
            'ext3': '2019',
            'ext4': null,
            'ext5': null,
            'children': []
          },
          {
            'searchValue': null,
            'createBy': '',
            'createTime': '2020-07-14 10:12:43',
            'updateBy': '',
            'updateTime': null,
            'remark': null,
            'params': {},
            'id': 579,
            'orderNum': 2020,
            'parentId': 576,
            'wmdaName': '2020年',
            'cp002': '2020',
            'dictid': null,
            'ext1': null,
            'ext2': '1',
            'ext3': '2020',
            'ext4': null,
            'ext5': null,
            'children': []
          }
        ]
      }, 800)
    },
    /**
     * 全屏
     */
    requestFullScreen() {
      let de = document.documentElement
      if (de.requestFullscreen) {
        de.requestFullscreen()
      } else if (de.mozRequestFullScreen) {
        de.mozRequestFullScreen()
      } else if (de.webkitRequestFullScreen) {
        de.webkitRequestFullScreen()
      }
    },
    goHome(year) {
      this.$router.push({ path: '/bigscreen/home', query: { year } })
      this.requestFullScreen()
    }

  }
}
</script>


<style scoped lang="scss">
.container {
  width: 100%;
  height: 100%;
  background-image: url('../../assets/bigscreen/bg.jpg');
  background-repeat: no-repeat;
  background-size: cover;


  .tableOfContents {
    display: flex;
    justify-content: center;
    padding-top: 31%;


    text-align: center;

    .yearItem {
      height: 70px;
      line-height: 70px;
      font-size: 40px;
      color: #FFFFFF;
      width: 180px;
      border-radius: 35px;
      background-image: linear-gradient(to right, #f96f6d, #fccc5a);
      margin: 0 3%;
      cursor: pointer;
    }
  }

}

</style>


